//
//  naviControllerFirst.m
//  wordlearn
//
//  Created by FEI RULIANG on 11-12-2.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import "tab1naviControllerMain.h"
#import "Tab1FirstViewController.h"
#import "Tab1SecondViewController.h"

@implementation Tab1NaviControllerMain

@synthesize firstView;
@synthesize secondView;

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma developer customize methods
-(void) secondSelected:(UIBarButtonItem *)item
{
    if(!self.secondView)
    {
        self.secondView = [[[Tab1SecondViewController alloc] initWithNibName:@"Tab1SecondViewController" bundle:NULL]autorelease];
    }
    
    [self pushViewController:self.secondView animated:TRUE];
    
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
}

- (id)initWithRootViewController:(UIViewController *)rootViewController
{
    if(rootViewController == NULL)
    {
        self.firstView = [[[Tab1FirstViewController alloc] initWithNibName:@"Tab1FirstViewController" bundle:NULL] autorelease];
        self.firstView.naviController = self;
        return [super initWithRootViewController:self.firstView];
    }
    else
    {
        return [super initWithRootViewController:rootViewController];
    }
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
	[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}


@end
